<%@ page contentType="text/html;charset=UTF-8" language="java" pageEncoding="UTF-8" %>
<%
    String path = request.getContextPath();
    String basePath = request.getScheme() + "://" + request.getServerName() + ":" + request.getServerPort() + path + "/";
%>
<!DOCTYPE html>
<html>
<head>
    <base href="<%=basePath%>">
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=Edge,chrome=1">
    <meta name="viewport" content="width=device-width, initial-scale=1.0,maximum-scale=1.0, user-scalable=no">
    <meta http-equiv="pragma" content="no-cache">
      
    <meta http-equiv="cache-control" content="no-cache">
      
    <meta http-equiv="expires" content="0">
    <title></title>
</head>
<body>
  <%!
      public double getArea(double radius){
          if (radius > 0) {
              double area = Math.PI * radius *radius;
              return area;
          } else {
              return -1;
          }

      }
      public double getPerimeter(double radius){
          if (radius>0){
              double Perimeter=2*radius* Math.PI;
              return Perimeter;
          }else {
              return -1;
          }
      }
  %>
  <%
      double radius=5;
      out.print("圆的面积："+getArea(radius)+"<br>");
      out.print("圆的周长："+getPerimeter(radius));
  %>
</body>
</html>
